package ru.spbu.math.android.cbrf.dataprovider;

import ru.spbu.math.android.cbrf.model.Rate;
import ru.spbu.math.android.cbrf.model.StockItem;

import java.util.Date;

public interface IProvider {

    /**
     * @param source
     * @param target
     * @return latest available rate
     */
    public Rate getLatestRate(StockItem source, StockItem target);

    /**
     * @return true if provider has update possibility now
     */
    public boolean isUpdatableNow();

    /**
     * @return true if provider supports getting Rate for optional Date
     */
    public boolean canGetRateByDate();

    /**
     * @param source
     * @param target
     * @param Date   since
     * @param Date   until
     * @return Rates Dynamic as Rates array
     */
    public Rate[] getDynamicRates(StockItem source, StockItem target,
                                  Date since, Date until);

    /**
     * @param source
     * @param target
     * @param date
     * @return Rate for optional Date
     */
    public Rate getRate(StockItem source, StockItem target, Date date);

}
